package com.link.play.fit.ai

import com.link.play.fit.ai.kv.AuthCache
import kotlinx.coroutines.flow.MutableStateFlow
import java.util.UUID

object GlobalConfig {
    //包名
    inline val PACKAGE_NAME get() = "com.link.play.kcal.ai"
    // 域名
    /**
     * Url Event 上报接口
     */
    const val URL_EVENT = "https://rp.goislandofficial.xyz"

    /**
     * Url Api 业务接口
     */
    const val URL_API = "https://api.goislandofficial.xyz"
//    const val URL_API = "https://feedapihk.zhangxinhulian.com"

    /**
     * Url Privacy 隐私链接
     */
    const val URL_PRIVACY = "https://kcal-ai-h.vercel.app/privacy"

    /**
     * Url Use 使用条款
     */
    const val URL_USE = "https://kcal-ai-h.vercel.app/terms"

    /**
     * Key Aes 加密key
     */
    const val KEY_AES = "rb63wp9c1du68wro"

    /**
     * Key solar 归因key
     */
    const val KEY_SOLAR = "bf0d187a6f3175bd"

    const val NO_VIP_NOTIFICATION_NAME = "noVipNotificationName" //未订阅用户推送
    const val NOTIFICATION_MORNING_REMINDER = "morning_reminder" //早餐
    const val NOTIFICATION_NOON_REMINDER = "noon_reminder" //午餐
    const val NOTIFICATION_EVENING_REMINDER = "evening_reminder" //晚餐
    const val NOTIFICATION_WEEKLY_MONDAY = "weekly_monday_push" //订阅用户每周一推送

    const val NOTIFICATION_DRINKING_REMINDER = "drink_reminder" //饮水
    const val NOTIFICATION_DRINKING_ID = 30001 //饮水
    const val NOTIFICATION_MEALS_MORNING_ID = 30002 //早餐
    const val NOTIFICATION_MEALS_NOON_ID = 30003 //午餐
    const val NOTIFICATION_MEALS_EVENING_ID = 30004 //晚餐


    const val SUB_YEAR_product_ID = "vip_year"
    const val SUB_WEEK1_PRODUCT_ID = "vip_week1"
    const val SUB_YEAR_DISCOUNT_PRODUCT_ID = "vip_year_discount"

    const val SUB_YEAR_PLAN_ID = "vip-year"
    const val SUB_YEAR_DISCOUNT_PLAN_ID = "vip-year-discount"
    const val SUB_WEEK1_PLAN_ID = "vip-week1"


    const val REMOTE_CONFIG_VIP_SWITCH = "VIP_SWITCH"
    const val REMOTE_CONFIG_VIP_PLAN_PAY = "VIP_PLAN_PAY"
    const val REMOTE_CONFIG_VIP_PRODUCT_WEEK = "VIP_PRODUCT_WEEK"
    const val REMOTE_CONFIG_VIP_PRODUCT_YEAR = "VIP_PRODUCT_YEAR"
    const val REMOTE_CONFIG_VIP_PRODUCT_YEAR_DISCOUNT = "VIP_PRODUCT_YEAR_DISCOUNT"
    const val REMOTE_CONFIG_VIP_PRODUCT_CALORIE_PLAN = "VIP_PRODUCT_CALORIE_PLAN"
    const val REMOTE_CONFIG_VIP_PRODUCT_CALORIE_PLAN_YEAR = "VIP_PRODUCT_CALORIE_PLAN_YEAR"
    const val REMOTE_CONFIG_VIP_DAYS_CALORIE_PLAN = "DAYS_CALORIE_PLAN"
    const val REMOTE_CONFIG_WEIGHT_CONTROL_GUIDE = "WEIGHT_CONTROL_GUIDE"
   // const val REMOTE_CONFIG_IS_SHOW_AD = "IS_SHOW_AD"
    inline var gloalsData
        get() = AuthCache.goalsData
        set(value) {
            AuthCache.goalsData = value
        }


    val imperialMetricFlow: MutableStateFlow<Boolean> = MutableStateFlow(AuthCache.imperialMetric)


    inline var imperialMetric
        get() = imperialMetricFlow.value
        set(value) {
            imperialMetricFlow.value = value
        }

    inline val uid
        get() = AuthCache.uid.ifBlank {
            //没有应用的uid就只有用生成的，保存到本地
            val newUid = UUID.randomUUID().toString()
            AuthCache.uid = newUid
            newUid
        }


    // admob广告位id
    inline val ID_ADMOB_APPLICATION get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544~3347511713" else "ca-app-pub-3940256099942544~3347511713"
    inline val ID_ADMOB_INTER get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/1033173712" else "ca-app-pub-3940256099942544/1033173712"
    inline val ID_ADMOB_NATIVE get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/2247696110" else "ca-app-pub-3940256099942544/2247696110"
    inline val ID_ADMOB_OPEN get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/9257395921" else "ca-app-pub-3940256099942544/9257395921"
    inline val ID_ADMOB_BANNER get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/9214589741" else "ca-app-pub-3940256099942544/9214589741"
    inline val ID_ADMOB_REWARD get() = if (BuildConfig.DEBUG) "ca-app-pub-3940256099942544/5224354917" else "ca-app-pub-3940256099942544/5224354917"


}